<!DOCTYPE html>
<html id="docs" lang="en" class="">
	<head>
	<meta charset="utf-8">
<title>Persistent Volumes - Kubernetes</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/png" href="../../../../images/favicon.png">
<link rel="stylesheet" type="text/css" href="../../../../css/base_fonts.css">
<link rel="stylesheet" type="text/css" href="../../../../css/styles.css">
<link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
<link rel="stylesheet" type="text/css" href="../../../../css/callouts.css">
<link rel="stylesheet" type="text/css" href="../../../../css/custom-jekyll/tags.css">




<meta name="description" content="Persistent Volumes" />
<meta property="og:description" content="Persistent Volumes" />

<meta property="og:url" content="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" />
<meta property="og:title" content="Persistent Volumes - Kubernetes" />

<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script
src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
<script src="../../../../js/script.js"></script>
<script src="../../../../js/custom-jekyll/tags.js"></script>


	</head>
	<body>
		<div id="cellophane" onclick="kub.toggleMenu()"></div>

<header>
    <a href="../../../../index.html" class="logo"></a>

    <div class="nav-buttons" data-auto-burger="primary">
        <ul class="global-nav">
            
            
            <li><a href="../../../home.1">Documentation</a></li>
            
            <li><a href="../../../../blog/index.html">Blog</a></li>
            
            <li><a href="../../../../partners/index.html">Partners</a></li>
            
            <li><a href="../../../../community/index.html">Community</a></li>
            
            <li><a href="../../../../case-studies/index.html">Case Studies</a></li>
            
            
             <li>
                <a href="../../../user-guide/persistent-volumes/index.html#">
                    English <span class="ui-icon ui-icon-carat-1-s"></span>
                </a>
                <ul>
                
                    <li><a href="../../../../zh/index.html">中文 Chinese</a></li>
                
                    <li><a href="../../../../ko/index.html">한국어 Korean</a></li>
                
                </ul>
            </li>
         
            <li>
                <a href="../../../user-guide/persistent-volumes/index.html#">
                    v1.11 <span class="ui-icon ui-icon-carat-1-s"></span>
                </a>
                <ul>
                
                    <li><a href="https://kubernetes.io">v1.12</a></li>
                
                    <li><a href="../../../../index.html">v1.11</a></li>
                
                    <li><a href="https://v1-10.docs.kubernetes.io">v1.10</a></li>
                
                    <li><a href="https://v1-9.docs.kubernetes.io">v1.9</a></li>
                
                </ul>
            </li>
        </ul>
        
        <a href="../../../tutorials/kubernetes-basics/index.html" class="button" id="tryKubernetes" data-auto-burger-exclude>Try Kubernetes</a>
        <button id="hamburger" onclick="kub.toggleMenu()" data-auto-burger-exclude><div></div></button>
    </div>

    <nav id="mainNav">
        <main data-auto-burger="primary">
        <div class="nav-box">
            <h3><a href="../../../tutorials/stateless-application/hello-minikube/index.html">Get Started</a></h3>
            <p>Ready to get your hands dirty? Build a simple Kubernetes cluster that runs "Hello World" for Node.js.</p>
        </div>
        <div class="nav-box">
            <h3><a href="../../../home.1">Documentation</a></h3>
            <p>Learn how to use Kubernetes with the use of walkthroughs, samples, and reference documentation. You can even <a href="../../../../editdocs/index.html" data-auto-burger-exclude>help contribute to the docs</a>!</p>
        </div>
        <div class="nav-box">
            <h3><a href="../../../../community/index.html">Community</a></h3>
            <p>If you need help, you can connect with other Kubernetes users and the Kubernetes authors, attend community events, and watch video presentations from around the web.</p>
        </div>
        <div class="nav-box">
            <h3><a href="../../../../blog/index.html">Blog</a></h3>
            <p>Read the latest news for Kubernetes and the containers space in general, and get technical how-tos hot off the presses.</p>
        </div>
        </main>
        <main data-auto-burger="primary">
        <div class="left">
            <h5 class="github-invite">Interested in hacking on the core Kubernetes code base?</h5>
            <a href="https://github.com/kubernetes/kubernetes" class="button" data-auto-burger-exclude>View On Github</a>
        </div>

        <div class="right">
            <h5 class="github-invite">Explore the community</h5>
            <div class="social">
                <a href="https://twitter.com/kubernetesio" class="twitter"><span>Twitter</span></a>
                <a href="https://github.com/kubernetes/kubernetes" class="github"><span>Github</span></a>
                <a href="http://slack.k8s.io/" class="slack"><span>Slack</span></a>
                <a href="http://stackoverflow.com/questions/tagged/kubernetes" class="stack-overflow"><span>Stack Overflow</span></a>
                <a href="https://discuss.kubernetes.io" class="mailing-list"><span>Forum</span></a>
                <a href="https://calendar.google.com/calendar/embed?src=nt2tcnbtbied3l6gi2h29slvc0%40group.calendar.google.com" class="calendar"><span>Events Calendar</span></a>
            </div>
        </div>
        <div class="clear" style="clear: both"></div>
        </main>
    </nav>
</header>

		
		
		<section id="hero" class="light-text no-sub">
			









<h1>Concepts</h1>
<h5></h5>








<div id="vendorStrip" class="light-text">
	<ul>
		
		
		<li><a href="../../../home.1">DOCUMENTATION</a></li>
		
		
		<li><a href="../../../setup/index.html">SETUP</a></li>
		
		
		<li><a href="../../index.html" class="YAH">CONCEPTS</a></li>
		
		
		<li><a href="../../../tasks/index.html">TASKS</a></li>
		
		
		<li><a href="../../../tutorials/index.html">TUTORIALS</a></li>
		
		
		<li><a href="../../../reference.1">REFERENCE</a></li>
		
	</ul>
	<div id="searchBox">
		<input type="text" id="search" placeholder="Search" onkeydown="if (event.keyCode==13) window.location.replace('/docs/search/?q=' + this.value)" autofocus="autofocus">
	</div>
</div>

		</section>
		
		
<section id="deprecationWarning">
  <main>
    <div class="content deprecation-warning">
      <h3>
        Documentation for Kubernetes v1.11 is no longer actively maintained. The version you are currently viewing is a static snapshot.
        For up-to-date documentation, see the <a href="https://kubernetes.io/docs/home/">latest</a> version.
      </h3>
    </div>
  </main>
</section>


		<section id="encyclopedia">
			
<div id="docsToc">
     <div class="pi-accordion">
    	
        
        
        
        
        
         
             
                 
             
         
             
                 
             
         
             
                 
                          
                          
                 
             
         
             
         
             
         
             
         
             
         
             
         
         
        
        <a class="item" data-title="Concepts" href="../../index.html"></a>

	
	
		
		
	<div class="item" data-title="Overview">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="What is Kubernetes?" href="../../overview/index.html"></a>

		
	
		
		
<a class="item" data-title="Kubernetes Components" href="../../overview/components.1"></a>

		
	
		
		
<a class="item" data-title="The Kubernetes API" href="../../overview/kubernetes-api/index.html"></a>

		
	
		
		
	<div class="item" data-title="Working with Kubernetes Objects">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Understanding Kubernetes Objects" href="../../overview/working-with-objects/kubernetes-objects.1"></a>

		
	
		
		
<a class="item" data-title="Names" href="../../../user-guide/identifiers"></a>

		
	
		
		
<a class="item" data-title="Namespaces" href="../../overview/working-with-objects/namespaces.1"></a>

		
	
		
		
<a class="item" data-title="Labels and Selectors" href="../../../user-guide/labels"></a>

		
	
		
		
<a class="item" data-title="Annotations" href="../../overview/working-with-objects/annotations.1"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Object Management Using kubectl">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Kubernetes Object Management" href="../../../tutorials/object-management-kubectl/object-management/index.html"></a>

		
	
		
		
<a class="item" data-title="Managing Kubernetes Objects Using Imperative Commands" href="../../../tutorials/object-management-kubectl/imperative-object-management-command/index.html"></a>

		
	
		
		
<a class="item" data-title="Imperative Management of Kubernetes Objects Using Configuration Files" href="../../../tutorials/object-management-kubectl/imperative-object-management-configuration/index.html"></a>

		
	
		
		
<a class="item" data-title="Declarative Management of Kubernetes Objects Using Configuration Files" href="../../../tutorials/object-management-kubectl/declarative-object-management-configuration/index.html"></a>

		
	

		</div>
	</div>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Compute, Storage, and Networking Extensions">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Cluster Administration Overview" href="../../cluster-administration/cluster-administration-overview/index.html"></a>

		
	
		
		
<a class="item" data-title="Certificates" href="../../cluster-administration/certificates/index.html"></a>

		
	
		
		
<a class="item" data-title="Cloud Providers" href="../../cluster-administration/cloud-providers/index.html"></a>

		
	
		
		
<a class="item" data-title="Managing Resources" href="../../cluster-administration/manage-deployment/index.html"></a>

		
	
		
		
<a class="item" data-title="Cluster Networking" href="../../../admin/networking"></a>

		
	
		
		
<a class="item" data-title="Logging Architecture" href="../../cluster-administration/logging.1"></a>

		
	
		
		
<a class="item" data-title="Configuring kubelet Garbage Collection" href="../../cluster-administration/kubelet-garbage-collection/index.html"></a>

		
	
		
		
<a class="item" data-title="Federation" href="../../cluster-administration/federation/index.html"></a>

		
	
		
		
<a class="item" data-title="Proxies in Kubernetes" href="../../cluster-administration/proxies/index.html"></a>

		
	
		
		
<a class="item" data-title="Controller manager metrics" href="../../cluster-administration/controller-metrics/index.html"></a>

		
	
		
		
<a class="item" data-title="Installing Addons" href="../../cluster-administration/addons/index.html"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Kubernetes Architecture">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Nodes" href="../../../admin/node.1"></a>

		
	
		
		
<a class="item" data-title="Master-Node communication" href="../../architecture/master-node-communication/index.html"></a>

		
	
		
		
<a class="item" data-title="Concepts Underlying the Cloud Controller Manager" href="../../architecture/cloud-controller/index.html"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Extending Kubernetes">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Extending your Kubernetes Cluster" href="../../overview/extending/index.html"></a>

		
	
		
		
	<div class="item" data-title="Extending the Kubernetes API">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Extending the Kubernetes API with the aggregation layer" href="../../api-extension/apiserver-aggregation.1"></a>

		
	
		
		
<a class="item" data-title="Custom Resources" href="../../api-extension/custom-resources/index.html"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Compute, Storage, and Networking Extensions">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Network Plugins" href="../../../admin/network-plugins/index.html"></a>

		
	
		
		
<a class="item" data-title="Device Plugins" href="../../cluster-administration/device-plugins.1"></a>

		
	

		</div>
	</div>

		
	
		
		
<a class="item" data-title="Service Catalog" href="../../service-catalog/index.html"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Containers">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Images" href="../../containers/images/index.html"></a>

		
	
		
		
<a class="item" data-title="Container Environment Variables" href="../../containers/container-environment-variables/index.html"></a>

		
	
		
		
<a class="item" data-title="Container Lifecycle Hooks" href="../../containers/container-lifecycle-hooks/index.html"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Workloads">
		<div class="container">
		
		
	
	
		
		
	<div class="item" data-title="Pods">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Pod Overview" href="../../workloads/pods/pod-overview/index.html"></a>

		
	
		
		
<a class="item" data-title="Pods" href="../../../user-guide/pods/index.html"></a>

		
	
		
		
<a class="item" data-title="Pod Lifecycle" href="../../../user-guide/pod-states/index.html"></a>

		
	
		
		
<a class="item" data-title="Init Containers" href="../../abstractions/init-containers/index.html"></a>

		
	
		
		
<a class="item" data-title="Pod Preset" href="../../workloads/pods/podpreset/index.html"></a>

		
	
		
		
<a class="item" data-title="Disruptions" href="../../workloads/pods/disruptions/index.html"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Controllers">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="ReplicaSet" href="../../workloads/controllers/replicaset/index.html"></a>

		
	
		
		
<a class="item" data-title="ReplicationController" href="../../../user-guide/replication-controller/index.html"></a>

		
	
		
		
<a class="item" data-title="Deployments" href="../../workloads/controllers/deployment/index.html"></a>

		
	
		
		
<a class="item" data-title="StatefulSets" href="../../workloads/controllers/statefulset.md"></a>

		
	
		
		
<a class="item" data-title="DaemonSet" href="../../workloads/controllers/daemonset.1"></a>

		
	
		
		
<a class="item" data-title="Garbage Collection" href="../../workloads/controllers/garbage-collection/index.html"></a>

		
	
		
		
<a class="item" data-title="Jobs - Run to Completion" href="../../workloads/controllers/jobs-run-to-completion.1"></a>

		
	
		
		
<a class="item" data-title="CronJob" href="../../workloads/controllers/cron-jobs.1"></a>

		
	

		</div>
	</div>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Configuration">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Configuration Best Practices" href="../../configuration/overview/index.html"></a>

		
	
		
		
<a class="item" data-title="Managing Compute Resources for Containers" href="../../../user-guide/compute-resources/index.html"></a>

		
	
		
		
<a class="item" data-title="Assigning Pods to Nodes" href="../../../user-guide/node-selection/index.html"></a>

		
	
		
		
<a class="item" data-title="Taints and Tolerations" href="../../configuration/taint-and-toleration.1"></a>

		
	
		
		
<a class="item" data-title="Secrets" href="../../../user-guide/secrets.1"></a>

		
	
		
		
<a class="item" data-title="Organizing Cluster Access Using kubeconfig Files" href="../../configuration/organize-cluster-access-kubeconfig/index.html"></a>

		
	
		
		
<a class="item" data-title="Pod Priority and Preemption" href="../../configuration/pod-priority-preemption/index.html"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Services, Load Balancing, and Networking">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Services" href="../../../user-guide/services"></a>

		
	
		
		
<a class="item" data-title="DNS for Services and Pods" href="../../services-networking/dns-pod-service/index.html"></a>

		
	
		
		
<a class="item" data-title="Connecting Applications with Services" href="../../services-networking/connect-applications-service.1"></a>

		
	
		
		
<a class="item" data-title="Ingress" href="../../services-networking/ingress/index.html"></a>

		
	
		
		
<a class="item" data-title="Network Policies" href="../../services-networking/networkpolicies/index.html"></a>

		
	
		
		
<a class="item" data-title="Adding entries to Pod /etc/hosts with HostAliases" href="../../services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/index.html"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Storage">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Volumes" href="../volumes.1"></a>

		
	
		
		
<a class="item" data-title="Persistent Volumes" href="../../../user-guide/persistent-volumes/index.html"></a>

		
	
		
		
<a class="item" data-title="Storage Classes" href="../storage-classes.1"></a>

		
	
		
		
<a class="item" data-title="Dynamic Volume Provisioning" href="../dynamic-provisioning/index.html"></a>

		
	
		
		
<a class="item" data-title="Node-specific Volume Limits" href="../storage-limits/index.html"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Policies">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Resource Quotas" href="../../policy/resource-quotas/index.html"></a>

		
	
		
		
<a class="item" data-title="Pod Security Policies" href="../../../user-guide/pod-security-policy"></a>

		
	

		</div>
	</div>

		
	






     </div> 
    <button class="push-menu-close-button" onclick="kub.toggleToc()"></button>
</div> 

			<div id="docsContent">
				
<p><a href="../../../editdocs#docs/concepts/storage/persistent-volumes.md" id="editPageButton">Edit This Page</a></p>

<h1>Persistent Volumes</h1>



<p>This document describes the current state of <code>PersistentVolumes</code> in Kubernetes. Familiarity with <a href="../volumes.1">volumes</a> is suggested.</p>









<ul id="markdown-toc">










<li><a href="../../../user-guide/persistent-volumes/index.html#introduction">Introduction</a></li>




<li><a href="../../../user-guide/persistent-volumes/index.html#lifecycle-of-a-volume-and-claim">Lifecycle of a volume and claim</a></li>




<li><a href="../../../user-guide/persistent-volumes/index.html#types-of-persistent-volumes">Types of Persistent Volumes</a></li>




<li><a href="../../../user-guide/persistent-volumes/index.html#persistent-volumes">Persistent Volumes</a></li>




<li><a href="../../../user-guide/persistent-volumes/index.html#persistentvolumeclaims">PersistentVolumeClaims</a></li>




<li><a href="../../../user-guide/persistent-volumes/index.html#claims-as-volumes">Claims As Volumes</a></li>




<li><a href="../../../user-guide/persistent-volumes/index.html#raw-block-volume-support">Raw Block Volume Support</a></li>




<li><a href="../../../user-guide/persistent-volumes/index.html#writing-portable-configuration">Writing Portable Configuration</a></li>



















</ul>


<h2 id="introduction">Introduction</h2>

<p>Managing storage is a distinct problem from managing compute. The <code>PersistentVolume</code> subsystem provides an API for users and administrators that abstracts details of how storage is provided from how it is consumed. To do this we introduce two new API resources:  <code>PersistentVolume</code> and <code>PersistentVolumeClaim</code>.</p>

<p>A <code>PersistentVolume</code> (PV) is a piece of storage in the cluster that has been provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. PVs are volume plugins like Volumes, but have a lifecycle independent of any individual pod that uses the PV. This API object captures the details of the implementation of the storage, be that NFS, iSCSI, or a cloud-provider-specific storage system.</p>

<p>A <code>PersistentVolumeClaim</code> (PVC) is a request for storage by a user. It is similar to a pod. Pods consume node resources and PVCs consume PV resources. Pods can request specific levels of resources (CPU and Memory).  Claims can request specific size and access modes (e.g., can be mounted once read/write or many times read-only).</p>

<p>While <code>PersistentVolumeClaims</code> allow a user to consume abstract storage
resources, it is common that users need <code>PersistentVolumes</code> with varying
properties, such as performance, for different problems. Cluster administrators
need to be able to offer a variety of <code>PersistentVolumes</code> that differ in more
ways than just size and access modes, without exposing users to the details of
how those volumes are implemented. For these needs there is the <code>StorageClass</code>
resource.</p>

<p>Please see the <a href="../../../tasks/configure-pod-container/configure-persistent-volume-storage/index.html">detailed walkthrough with working examples</a>.</p>

<h2 id="lifecycle-of-a-volume-and-claim">Lifecycle of a volume and claim</h2>

<p>PVs are resources in the cluster. PVCs are requests for those resources and also act as claim checks to the resource. The interaction between PVs and PVCs follows this lifecycle:</p>

<h3 id="provisioning">Provisioning</h3>

<p>There are two ways PVs may be provisioned: statically or dynamically.</p>

<h4 id="static">Static</h4>

<p>A cluster administrator creates a number of PVs. They carry the details of the real storage which is available for use by cluster users. They exist in the Kubernetes API and are available for consumption.</p>

<h4 id="dynamic">Dynamic</h4>

<p>When none of the static PVs the administrator created matches a user&rsquo;s <code>PersistentVolumeClaim</code>,
the cluster may try to dynamically provision a volume specially for the PVC.
This provisioning is based on <code>StorageClasses</code>: the PVC must request a
<a href="../storage-classes.1">storage class</a> and
the administrator must have created and configured that class in order for dynamic
provisioning to occur. Claims that request the class <code>&quot;&quot;</code> effectively disable
dynamic provisioning for themselves.</p>

<p>To enable dynamic storage provisioning based on storage class, the cluster administrator
needs to enable the <code>DefaultStorageClass</code> <a href="../../../admin/admission-controllers/index.html#defaultstorageclass">admission controller</a>
on the API server. This can be done, for example, by ensuring that <code>DefaultStorageClass</code> is
among the comma-delimited, ordered list of values for the <code>--enable-admission-plugins</code> flag of
the API server component. For more information on API server command line flags,
please check <a href="../../../admin/kube-apiserver/index.html">kube-apiserver</a> documentation.</p>

<h3 id="binding">Binding</h3>

<p>A user creates, or has already created in the case of dynamic provisioning, a <code>PersistentVolumeClaim</code> with a specific amount of storage requested and with certain access modes. A control loop in the master watches for new PVCs, finds a matching PV (if possible), and binds them together. If a PV was dynamically provisioned for a new PVC, the loop will always bind that PV to the PVC. Otherwise, the user will always get at least what they asked for, but the volume may be in excess of what was requested. Once bound, <code>PersistentVolumeClaim</code> binds are exclusive, regardless of how they were bound. A PVC to PV binding is a one-to-one mapping.</p>

<p>Claims will remain unbound indefinitely if a matching volume does not exist. Claims will be bound as matching volumes become available. For example, a cluster provisioned with many 50Gi PVs would not match a PVC requesting 100Gi. The PVC can be bound when a 100Gi PV is added to the cluster.</p>

<h3 id="using">Using</h3>

<p>Pods use claims as volumes. The cluster inspects the claim to find the bound volume and mounts that volume for a pod. For volumes which support multiple access modes, the user specifies which mode is desired when using their claim as a volume in a pod.</p>

<p>Once a user has a claim and that claim is bound, the bound PV belongs to the user for as long as they need it. Users schedule Pods and access their claimed PVs by including a <code>persistentVolumeClaim</code> in their Pod&rsquo;s volumes block. <a href="../../../user-guide/persistent-volumes/index.html#claims-as-volumes">See below for syntax details</a>.</p>

<h3 id="storage-object-in-use-protection">Storage Object in Use Protection</h3>

<p>The purpose of the Storage Object in Use Protection feature is to ensure that Persistent Volume Claims (PVCs) in active use by a pod and Persistent Volume (PVs) that are bound to PVCs are not removed from the system as this may result in data loss.</p>

<blockquote class="note">
  <div><strong>Note:</strong> PVC is in active use by a pod when the pod status is <code>Pending</code> and the pod is assigned to a node or the pod status is <code>Running</code>.</div>
</blockquote>

<p>When the <a href="../../../tasks/administer-cluster/storage-object-in-use-protection/index.html">Storage Object in Use Protection feature</a> is enabled, if a user deletes a PVC in active use by a pod, the PVC is not removed immediately. PVC removal is postponed until the PVC is no longer actively used by any pods, and also if admin deletes a PV that is bound to a PVC, the PV is not removed immediately. PV removal is postponed until the PV is not bound to a PVC any more.</p>

<p>You can see that a PVC is protected when the PVC&rsquo;s status is <code>Terminating</code> and the <code>Finalizers</code> list includes <code>kubernetes.io/pvc-protection</code>:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl describe pvc hostpath
Name:          hostpath
Namespace:     default
StorageClass:  example-hostpath
Status:        Terminating
Volume:        
Labels:        &lt;none&gt;
Annotations:   volume.beta.kubernetes.io/storage-class<span style="color:#666">=</span>example-hostpath
               volume.beta.kubernetes.io/storage-provisioner<span style="color:#666">=</span>example.com/hostpath
Finalizers:    <span style="color:#666">[</span>kubernetes.io/pvc-protection<span style="color:#666">]</span>
...</code></pre></div>
<p>You can see that a PV is protected when the PV&rsquo;s status is <code>Terminating</code> and the <code>Finalizers</code> list includes <code>kubernetes.io/pv-protection</code> too:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">kubectl describe pv task-pv-volume
Name:            task-pv-volume
Labels:          <span style="color:#b8860b">type</span><span style="color:#666">=</span><span style="color:#a2f">local</span>
Annotations:     &lt;none&gt;
Finalizers:      <span style="color:#666">[</span>kubernetes.io/pv-protection<span style="color:#666">]</span>
StorageClass:    standard
Status:          Available
Claim:           
Reclaim Policy:  Delete
Access Modes:    RWO
Capacity:        1Gi
Message:         
Source:
    Type:          HostPath <span style="color:#666">(</span>bare host directory volume<span style="color:#666">)</span>
    Path:          /tmp/data
    HostPathType:  
Events:            &lt;none&gt;</code></pre></div>
<h3 id="reclaiming">Reclaiming</h3>

<p>When a user is done with their volume, they can delete the PVC objects from the API which allows reclamation of the resource. The reclaim policy for a <code>PersistentVolume</code> tells the cluster what to do with the volume after it has been released of its claim. Currently, volumes can either be Retained, Recycled or Deleted.</p>

<h4 id="retain">Retain</h4>

<p>The <code>Retain</code> reclaim policy allows for manual reclamation of the resource. When the <code>PersistentVolumeClaim</code> is deleted, the <code>PersistentVolume</code> still exists and the volume is considered &ldquo;released&rdquo;. But it is not yet available for another claim because the previous claimant&rsquo;s data remains on the volume. An administrator can manually reclaim the volume with the following steps.</p>

<ol>
<li>Delete the <code>PersistentVolume</code>. The associated storage asset in external infrastructure (such as an AWS EBS, GCE PD, Azure Disk, or Cinder volume) still exists after the PV is deleted.</li>
<li>Manually clean up the data on the associated storage asset accordingly.</li>
<li>Manually delete the associated storage asset, or if you want to reuse the same storage asset, create a new <code>PersistentVolume</code> with the storage asset definition.</li>
</ol>

<h4 id="delete">Delete</h4>

<p>For volume plugins that support the <code>Delete</code> reclaim policy, deletion removes both the <code>PersistentVolume</code> object from Kubernetes, as well as the associated storage asset in the external infrastructure, such as an AWS EBS, GCE PD, Azure Disk, or Cinder volume. Volumes that were dynamically provisioned inherit the <a href="../../../user-guide/persistent-volumes/index.html#reclaim-policy">reclaim policy of their <code>StorageClass</code></a>, which defaults to <code>Delete</code>. The administrator should configure the <code>StorageClass</code> according to users&rsquo; expectations, otherwise the PV must be edited or patched after it is created. See <a href="../../../tasks/administer-cluster/change-pv-reclaim-policy/index.html">Change the Reclaim Policy of a PersistentVolume</a>.</p>

<h4 id="recycle">Recycle</h4>

<blockquote class="warning">
  <div><strong>Warning:</strong> The <code>Recycle</code> reclaim policy is deprecated. Instead, the recommended approach is to use dynamic provisioning.</div>
</blockquote>

<p>If supported by the underlying volume plugin, the <code>Recycle</code> reclaim policy performs a basic scrub (<code>rm -rf /thevolume/*</code>) on the volume and makes it available again for a new claim.</p>

<p>However, an administrator can configure a custom recycler pod template using the Kubernetes controller manager command line arguments as described <a href="../../../admin/kube-controller-manager/index.html">here</a>. The custom recycler pod template must contain a <code>volumes</code> specification, as shown in the example below:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml">apiVersion:<span style="color:#bbb"> </span>v1<span style="color:#bbb">
</span><span style="color:#bbb"></span>kind:<span style="color:#bbb"> </span>Pod<span style="color:#bbb">
</span><span style="color:#bbb"></span>metadata:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>name:<span style="color:#bbb"> </span>pv-recycler<span style="color:#bbb">
</span><span style="color:#bbb">  </span>namespace:<span style="color:#bbb"> </span>default<span style="color:#bbb">
</span><span style="color:#bbb"></span>spec:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>restartPolicy:<span style="color:#bbb"> </span>Never<span style="color:#bbb">
</span><span style="color:#bbb">  </span>volumes:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>-<span style="color:#bbb"> </span>name:<span style="color:#bbb"> </span>vol<span style="color:#bbb">
</span><span style="color:#bbb">    </span>hostPath:<span style="color:#bbb">
</span><span style="color:#bbb">      </span>path:<span style="color:#bbb"> </span>/any/path/it/will/be/replaced<span style="color:#bbb">
</span><span style="color:#bbb">  </span>containers:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>-<span style="color:#bbb"> </span>name:<span style="color:#bbb"> </span>pv-recycler<span style="color:#bbb">
</span><span style="color:#bbb">    </span>image:<span style="color:#bbb"> </span><span style="color:#b44">&#34;k8s.gcr.io/busybox&#34;</span><span style="color:#bbb">
</span><span style="color:#bbb">    </span>command:<span style="color:#bbb"> </span>[<span style="color:#b44">&#34;/bin/sh&#34;</span>,<span style="color:#bbb"> </span><span style="color:#b44">&#34;-c&#34;</span>,<span style="color:#bbb"> </span><span style="color:#b44">&#34;test -e /scrub &amp;&amp; rm -rf /scrub/..?* /scrub/.[!.]* /scrub/*  &amp;&amp; test -z \&#34;$(ls -A /scrub)\&#34; || exit 1&#34;</span>]<span style="color:#bbb">
</span><span style="color:#bbb">    </span>volumeMounts:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>-<span style="color:#bbb"> </span>name:<span style="color:#bbb"> </span>vol<span style="color:#bbb">
</span><span style="color:#bbb">      </span>mountPath:<span style="color:#bbb"> </span>/scrub</code></pre></div>
<p>However, the particular path specified in the custom recycler pod template in the <code>volumes</code> part is replaced with the particular path of the volume that is being recycled.</p>

<h3 id="expanding-persistent-volumes-claims">Expanding Persistent Volumes Claims</h3>

<div style="margin-top: 10px; margin-bottom: 10px;">



<b>FEATURE STATE:</b> <code>Kubernetes v1.8</code>




    
    
    
    
    
<a href="../../../user-guide/persistent-volumes/index.html#" id="feature-state-dialog-link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>alpha</a>
<div id="feature-state-dialog" class="ui-dialog-content" title="alpha">
This feature is currently in a <em>alpha</em> state, meaning:</p>

<ul>
<li>The version names contain alpha (e.g. v1alpha1).</li>
<li>Might be buggy. Enabling the feature may expose bugs. Disabled by default.</li>
<li>Support for feature may be dropped at any time without notice.</li>
<li>The API may change in incompatible ways in a later software release without notice.</li>
<li>Recommended for use only in short-lived testing clusters, due to increased risk of bugs and lack of long-term support.</li>
</ul>

</div>
<script>
$(function(){
    
    $( "#feature-state-dialog" ).dialog({
        autoOpen: false,
        width: "600",
        buttons: [
            {
                text: "Ok",
                click: function() {
                    $( this ).dialog( "close" );
                }
            }
        ]
    });

    
    $( "#feature-state-dialog-link" ).click(function( event ) {
        $( "#feature-state-dialog" ).dialog( "open" );
        event.preventDefault();
    });

});
</script>

    

</div>

<div style="margin-top: 10px; margin-bottom: 10px;">



<b>FEATURE STATE:</b> <code>Kubernetes v1.11</code>




    
    
    
    
    
<a href="../../../user-guide/persistent-volumes/index.html#" id="feature-state-dialog-link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>beta</a>
<div id="feature-state-dialog" class="ui-dialog-content" title="beta">
This feature is currently in a <em>beta</em> state, meaning:</p>

<ul>
<li>The version names contain beta (e.g. v2beta3).</li>
<li>Code is well tested. Enabling the feature is considered safe. Enabled by default.</li>
<li>Support for the overall feature will not be dropped, though details may change.</li>
<li>The schema and/or semantics of objects may change in incompatible ways in a subsequent beta or stable release. When this happens, we will provide instructions for migrating to the next version. This may require deleting, editing, and re-creating API objects. The editing process may require some thought. This may require downtime for applications that rely on the feature.</li>
<li>Recommended for only non-business-critical uses because of potential for incompatible changes in subsequent releases. If you have multiple clusters that can be upgraded independently, you may be able to relax this restriction.</li>
<li><strong>Please do try our beta features and give feedback on them! After they exit beta, it may not be practical for us to make more changes.</strong></li>
</ul>

</div>
<script>
$(function(){
    
    $( "#feature-state-dialog" ).dialog({
        autoOpen: false,
        width: "600",
        buttons: [
            {
                text: "Ok",
                click: function() {
                    $( this ).dialog( "close" );
                }
            }
        ]
    });

    
    $( "#feature-state-dialog-link" ).click(function( event ) {
        $( "#feature-state-dialog" ).dialog( "open" );
        event.preventDefault();
    });

});
</script>

    

</div>

<p>Support for expanding PersistentVolumeClaims (PVCs) is now enabled by default. You can expand
the following types of volumes:</p>

<ul>
<li>gcePersistentDisk</li>
<li>awsElasticBlockStore</li>
<li>Cinder</li>
<li>glusterfs</li>
<li>rbd</li>
<li>Azure File</li>
<li>Azure Disk</li>
<li>Portworx</li>
</ul>

<p>You can only expand a PVC if its storage class&rsquo;s <code>allowVolumeExpansion</code> field is set to true.</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml">kind:<span style="color:#bbb"> </span>StorageClass<span style="color:#bbb">
</span><span style="color:#bbb"></span>apiVersion:<span style="color:#bbb"> </span>storage.k8s.io/v1<span style="color:#bbb">
</span><span style="color:#bbb"></span>metadata:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>name:<span style="color:#bbb"> </span>gluster-vol-default<span style="color:#bbb">
</span><span style="color:#bbb"></span>provisioner:<span style="color:#bbb"> </span>kubernetes.io/glusterfs<span style="color:#bbb">
</span><span style="color:#bbb"></span>parameters:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>resturl:<span style="color:#bbb"> </span><span style="color:#b44">&#34;http://192.168.10.100:8080&#34;</span><span style="color:#bbb">
</span><span style="color:#bbb">  </span>restuser:<span style="color:#bbb"> </span><span style="color:#b44">&#34;&#34;</span><span style="color:#bbb">
</span><span style="color:#bbb">  </span>secretNamespace:<span style="color:#bbb"> </span><span style="color:#b44">&#34;&#34;</span><span style="color:#bbb">
</span><span style="color:#bbb">  </span>secretName:<span style="color:#bbb"> </span><span style="color:#b44">&#34;&#34;</span><span style="color:#bbb">
</span><span style="color:#bbb"></span>allowVolumeExpansion:<span style="color:#bbb"> </span><span style="color:#a2f;font-weight:bold">true</span></code></pre></div>
<p>To request a larger volume for a PVC, edit the PVC object and specify a larger
size. This triggers expansion of the volume that backs the underlying <code>PersistentVolume</code>. A
new <code>PersistentVolume</code> is never created to satisfy the claim. Instead, an existing volume is resized.</p>

<h4 id="resizing-a-volume-containing-a-file-system">Resizing a volume containing a file system</h4>

<p>You can only resize volumes containing a file system if the file system is XFS, Ext3, or Ext4.</p>

<p>When a volume contains a file system, the file system is only resized when a new Pod is started using
the <code>PersistentVolumeClaim</code> in ReadWrite mode. Therefore, if a pod or deployment is using a volume and
you want to expand it, you need to delete or recreate the pod after the volume has been exxpanded by the cloud provider in the controller-manager. You can check the status of resize operation by running the <code>kubectl describe pvc</code> command:</p>

<pre><code>kubectl describe pvc &lt;pvc_name&gt;
</code></pre>

<p>If the <code>PersistentVolumeClaim</code> has the status <code>FileSystemResizePending</code>, it is safe to recreate the pod using the PersistentVolumeClaim.</p>

<h4 id="resizing-an-in-use-persistentvolumeclaim">Resizing an in-use PersistentVolumeClaim</h4>

<div style="margin-top: 10px; margin-bottom: 10px;">



<b>FEATURE STATE:</b> <code>Kubernetes v1.11</code>




    
    
    
    
    
<a href="../../../user-guide/persistent-volumes/index.html#" id="feature-state-dialog-link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>alpha</a>
<div id="feature-state-dialog" class="ui-dialog-content" title="alpha">
This feature is currently in a <em>alpha</em> state, meaning:</p>

<ul>
<li>The version names contain alpha (e.g. v1alpha1).</li>
<li>Might be buggy. Enabling the feature may expose bugs. Disabled by default.</li>
<li>Support for feature may be dropped at any time without notice.</li>
<li>The API may change in incompatible ways in a later software release without notice.</li>
<li>Recommended for use only in short-lived testing clusters, due to increased risk of bugs and lack of long-term support.</li>
</ul>

</div>
<script>
$(function(){
    
    $( "#feature-state-dialog" ).dialog({
        autoOpen: false,
        width: "600",
        buttons: [
            {
                text: "Ok",
                click: function() {
                    $( this ).dialog( "close" );
                }
            }
        ]
    });

    
    $( "#feature-state-dialog-link" ).click(function( event ) {
        $( "#feature-state-dialog" ).dialog( "open" );
        event.preventDefault();
    });

});
</script>

    

</div>

<p>Expanding in-use PVCs is an alpha feature. To use it, enable the <code>ExpandInUsePersistentVolumes</code> feature gate.
In this case, you don&rsquo;t need to delete and recreate a Pod or deployment that is using an existing PVC.
Any in-use PVC automatically becomes available to its Pod as soon as its file system has been expanded.
This feature has no effect on PVCs that are not in use by a Pod or deployment. You must create a Pod which
uses the PVC before the expansion can complete.</p>

<blockquote class="note">
  <div><strong>Note:</strong> Expanding EBS volumes is a time consuming operation. Also, there is a per-volume quota of one modification every 6 hours.</div>
</blockquote>

<h2 id="types-of-persistent-volumes">Types of Persistent Volumes</h2>

<p><code>PersistentVolume</code> types are implemented as plugins.  Kubernetes currently supports the following plugins:</p>

<ul>
<li>GCEPersistentDisk</li>
<li>AWSElasticBlockStore</li>
<li>AzureFile</li>
<li>AzureDisk</li>
<li>FC (Fibre Channel)</li>
<li>FlexVolume</li>
<li>Flocker</li>
<li>NFS</li>
<li>iSCSI</li>
<li>RBD (Ceph Block Device)</li>
<li>CephFS</li>
<li>Cinder (OpenStack block storage)</li>
<li>Glusterfs</li>
<li>VsphereVolume</li>
<li>Quobyte Volumes</li>
<li>HostPath (Single node testing only &ndash; local storage is not supported in any way and WILL NOT WORK in a multi-node cluster)</li>
<li>Portworx Volumes</li>
<li>ScaleIO Volumes</li>
<li>StorageOS</li>
</ul>

<h2 id="persistent-volumes">Persistent Volumes</h2>

<p>Each PV contains a spec and status, which is the specification and status of the volume.</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml">apiVersion:<span style="color:#bbb"> </span>v1<span style="color:#bbb">
</span><span style="color:#bbb"></span>kind:<span style="color:#bbb"> </span>PersistentVolume<span style="color:#bbb">
</span><span style="color:#bbb"></span>metadata:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>name:<span style="color:#bbb"> </span>pv0003<span style="color:#bbb">
</span><span style="color:#bbb"></span>spec:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>capacity:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>storage:<span style="color:#bbb"> </span>5Gi<span style="color:#bbb">
</span><span style="color:#bbb">  </span>volumeMode:<span style="color:#bbb"> </span>Filesystem<span style="color:#bbb">
</span><span style="color:#bbb">  </span>accessModes:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>-<span style="color:#bbb"> </span>ReadWriteOnce<span style="color:#bbb">
</span><span style="color:#bbb">  </span>persistentVolumeReclaimPolicy:<span style="color:#bbb"> </span>Recycle<span style="color:#bbb">
</span><span style="color:#bbb">  </span>storageClassName:<span style="color:#bbb"> </span>slow<span style="color:#bbb">
</span><span style="color:#bbb">  </span>mountOptions:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>-<span style="color:#bbb"> </span>hard<span style="color:#bbb">
</span><span style="color:#bbb">    </span>-<span style="color:#bbb"> </span>nfsvers=<span style="color:#666">4.1</span><span style="color:#bbb">
</span><span style="color:#bbb">  </span>nfs:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>path:<span style="color:#bbb"> </span>/tmp<span style="color:#bbb">
</span><span style="color:#bbb">    </span>server:<span style="color:#bbb"> </span><span style="color:#666">172.17</span>.<span style="color:#666">0.2</span></code></pre></div>
<h3 id="capacity">Capacity</h3>

<p>Generally, a PV will have a specific storage capacity.  This is set using the PV&rsquo;s <code>capacity</code> attribute.  See the Kubernetes <a href="https://git.k8s.io/community/contributors/design-proposals/scheduling/resources.md" target="_blank">Resource Model</a> to understand the units expected by <code>capacity</code>.</p>

<p>Currently, storage size is the only resource that can be set or requested.  Future attributes may include IOPS, throughput, etc.</p>

<h3 id="volume-mode">Volume Mode</h3>

<div style="margin-top: 10px; margin-bottom: 10px;">



<b>FEATURE STATE:</b> <code>Kubernetes v1.9</code>




    
    
    
    
    
<a href="../../../user-guide/persistent-volumes/index.html#" id="feature-state-dialog-link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>alpha</a>
<div id="feature-state-dialog" class="ui-dialog-content" title="alpha">
This feature is currently in a <em>alpha</em> state, meaning:</p>

<ul>
<li>The version names contain alpha (e.g. v1alpha1).</li>
<li>Might be buggy. Enabling the feature may expose bugs. Disabled by default.</li>
<li>Support for feature may be dropped at any time without notice.</li>
<li>The API may change in incompatible ways in a later software release without notice.</li>
<li>Recommended for use only in short-lived testing clusters, due to increased risk of bugs and lack of long-term support.</li>
</ul>

</div>
<script>
$(function(){
    
    $( "#feature-state-dialog" ).dialog({
        autoOpen: false,
        width: "600",
        buttons: [
            {
                text: "Ok",
                click: function() {
                    $( this ).dialog( "close" );
                }
            }
        ]
    });

    
    $( "#feature-state-dialog-link" ).click(function( event ) {
        $( "#feature-state-dialog" ).dialog( "open" );
        event.preventDefault();
    });

});
</script>

    

</div>

<p>To enable this feature, enable the <code>BlockVolume</code> feature gate on the apiserver, controller-manager and the kubelet.</p>

<p>Prior to Kubernetes 1.9, all volume plugins created a filesystem on the persistent volume.
Now, you can set the value of <code>volumeMode</code> to <code>raw</code> to use a raw block device, or <code>filesystem</code>
to use a filesystem. <code>filesystem</code> is the default if the value is omitted. This is an optional API
parameter.</p>

<h3 id="access-modes">Access Modes</h3>

<p>A <code>PersistentVolume</code> can be mounted on a host in any way supported by the resource provider.  As shown in the table below, providers will have different capabilities and each PV&rsquo;s access modes are set to the specific modes supported by that particular volume.  For example, NFS can support multiple read/write clients, but a specific NFS PV might be exported on the server as read-only.  Each PV gets its own set of access modes describing that specific PV&rsquo;s capabilities.</p>

<p>The access modes are:</p>

<ul>
<li>ReadWriteOnce &ndash; the volume can be mounted as read-write by a single node</li>
<li>ReadOnlyMany &ndash; the volume can be mounted read-only by many nodes</li>
<li>ReadWriteMany &ndash; the volume can be mounted as read-write by many nodes</li>
</ul>

<p>In the CLI, the access modes are abbreviated to:</p>

<ul>
<li>RWO - ReadWriteOnce</li>
<li>ROX - ReadOnlyMany</li>
<li>RWX - ReadWriteMany</li>
</ul>

<blockquote>
<p><strong>Important!</strong> A volume can only be mounted using one access mode at a time, even if it supports many.  For example, a GCEPersistentDisk can be mounted as ReadWriteOnce by a single node or ReadOnlyMany by many nodes, but not at the same time.</p>
</blockquote>

<table>
<thead>
<tr>
<th align="left">Volume Plugin</th>
<th align="center">ReadWriteOnce</th>
<th align="center">ReadOnlyMany</th>
<th align="center">ReadWriteMany</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">AWSElasticBlockStore</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
<td align="center">-</td>
</tr>

<tr>
<td align="left">AzureFile</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
</tr>

<tr>
<td align="left">AzureDisk</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
<td align="center">-</td>
</tr>

<tr>
<td align="left">CephFS</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
</tr>

<tr>
<td align="left">Cinder</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
<td align="center">-</td>
</tr>

<tr>
<td align="left">FC</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
</tr>

<tr>
<td align="left">FlexVolume</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
</tr>

<tr>
<td align="left">Flocker</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
<td align="center">-</td>
</tr>

<tr>
<td align="left">GCEPersistentDisk</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
</tr>

<tr>
<td align="left">Glusterfs</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
</tr>

<tr>
<td align="left">HostPath</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
<td align="center">-</td>
</tr>

<tr>
<td align="left">iSCSI</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
</tr>

<tr>
<td align="left">Quobyte</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
</tr>

<tr>
<td align="left">NFS</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
</tr>

<tr>
<td align="left">RBD</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
</tr>

<tr>
<td align="left">VsphereVolume</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
<td align="center">- (works when pods are collocated)</td>
</tr>

<tr>
<td align="left">PortworxVolume</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
<td align="center">&#x2713;</td>
</tr>

<tr>
<td align="left">ScaleIO</td>
<td align="center">&#x2713;</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
</tr>

<tr>
<td align="left">StorageOS</td>
<td align="center">&#x2713;</td>
<td align="center">-</td>
<td align="center">-</td>
</tr>
</tbody>
</table>

<h3 id="class">Class</h3>

<p>A PV can have a class, which is specified by setting the
<code>storageClassName</code> attribute to the name of a
<a href="../storage-classes.1">StorageClass</a>.
A PV of a particular class can only be bound to PVCs requesting
that class. A PV with no <code>storageClassName</code> has no class and can only be bound
to PVCs that request no particular class.</p>

<p>In the past, the annotation <code>volume.beta.kubernetes.io/storage-class</code> was used instead
of the <code>storageClassName</code> attribute. This annotation is still working, however
it will become fully deprecated in a future Kubernetes release.</p>

<h3 id="reclaim-policy">Reclaim Policy</h3>

<p>Current reclaim policies are:</p>

<ul>
<li>Retain &ndash; manual reclamation</li>
<li>Recycle &ndash; basic scrub (<code>rm -rf /thevolume/*</code>)</li>
<li>Delete &ndash; associated storage asset such as AWS EBS, GCE PD, Azure Disk, or OpenStack Cinder volume is deleted</li>
</ul>

<p>Currently, only NFS and HostPath support recycling. AWS EBS, GCE PD, Azure Disk, and Cinder volumes support deletion.</p>

<h3 id="mount-options">Mount Options</h3>

<p>A Kubernetes administrator can specify additional mount options for when a Persistent Volume is mounted on a node.</p>

<blockquote class="note">
  <div><strong>Note:</strong> Not all Persistent volume types support mount options.</div>
</blockquote>

<p>The following volume types support mount options:</p>

<ul>
<li>GCEPersistentDisk</li>
<li>AWSElasticBlockStore</li>
<li>AzureFile</li>
<li>AzureDisk</li>
<li>NFS</li>
<li>iSCSI</li>
<li>RBD (Ceph Block Device)</li>
<li>CephFS</li>
<li>Cinder (OpenStack block storage)</li>
<li>Glusterfs</li>
<li>VsphereVolume</li>
<li>Quobyte Volumes</li>
</ul>

<p>Mount options are not validated, so mount will simply fail if one is invalid.</p>

<p>In the past, the annotation <code>volume.beta.kubernetes.io/mount-options</code> was used instead
of the <code>mountOptions</code> attribute. This annotation is still working, however
it will become fully deprecated in a future Kubernetes release.</p>

<h3 id="phase">Phase</h3>

<p>A volume will be in one of the following phases:</p>

<ul>
<li>Available &ndash; a free resource that is not yet bound to a claim</li>
<li>Bound &ndash; the volume is bound to a claim</li>
<li>Released &ndash; the claim has been deleted, but the resource is not yet reclaimed by the cluster</li>
<li>Failed &ndash; the volume has failed its automatic reclamation</li>
</ul>

<p>The CLI will show the name of the PVC bound to the PV.</p>

<h2 id="persistentvolumeclaims">PersistentVolumeClaims</h2>

<p>Each PVC contains a spec and status, which is the specification and status of the claim.</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml">kind:<span style="color:#bbb"> </span>PersistentVolumeClaim<span style="color:#bbb">
</span><span style="color:#bbb"></span>apiVersion:<span style="color:#bbb"> </span>v1<span style="color:#bbb">
</span><span style="color:#bbb"></span>metadata:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>name:<span style="color:#bbb"> </span>myclaim<span style="color:#bbb">
</span><span style="color:#bbb"></span>spec:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>accessModes:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>-<span style="color:#bbb"> </span>ReadWriteOnce<span style="color:#bbb">
</span><span style="color:#bbb">  </span>volumeMode:<span style="color:#bbb"> </span>Filesystem<span style="color:#bbb">
</span><span style="color:#bbb">  </span>resources:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>requests:<span style="color:#bbb">
</span><span style="color:#bbb">      </span>storage:<span style="color:#bbb"> </span>8Gi<span style="color:#bbb">
</span><span style="color:#bbb">  </span>storageClassName:<span style="color:#bbb"> </span>slow<span style="color:#bbb">
</span><span style="color:#bbb">  </span>selector:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>matchLabels:<span style="color:#bbb">
</span><span style="color:#bbb">      </span>release:<span style="color:#bbb"> </span><span style="color:#b44">&#34;stable&#34;</span><span style="color:#bbb">
</span><span style="color:#bbb">    </span>matchExpressions:<span style="color:#bbb">
</span><span style="color:#bbb">      </span>-<span style="color:#bbb"> </span>{key:<span style="color:#bbb"> </span>environment,<span style="color:#bbb"> </span>operator:<span style="color:#bbb"> </span>In,<span style="color:#bbb"> </span>values:<span style="color:#bbb"> </span>[dev]}</code></pre></div>
<h3 id="access-modes-1">Access Modes</h3>

<p>Claims use the same conventions as volumes when requesting storage with specific access modes.</p>

<h3 id="volume-modes">Volume Modes</h3>

<p>Claims use the same convention as volumes to indicates the consumption of the volume as either a filesystem or block device.</p>

<h3 id="resources">Resources</h3>

<p>Claims, like pods, can request specific quantities of a resource.  In this case, the request is for storage.  The same <a href="https://git.k8s.io/community/contributors/design-proposals/scheduling/resources.md" target="_blank">resource model</a> applies to both volumes and claims.</p>

<h3 id="selector">Selector</h3>

<p>Claims can specify a <a href="../../../user-guide/labels#label-selectors">label selector</a> to further filter the set of volumes. Only the volumes whose labels match the selector can be bound to the claim. The selector can consist of two fields:</p>

<ul>
<li><code>matchLabels</code> - the volume must have a label with this value</li>
<li><code>matchExpressions</code> - a list of requirements made by specifying key, list of values, and operator that relates the key and values. Valid operators include In, NotIn, Exists, and DoesNotExist.</li>
</ul>

<p>All of the requirements, from both <code>matchLabels</code> and <code>matchExpressions</code> are ANDed together – they must all be satisfied in order to match.</p>

<h3 id="class-1">Class</h3>

<p>A claim can request a particular class by specifying the name of a
<a href="../storage-classes.1">StorageClass</a>
using the attribute <code>storageClassName</code>.
Only PVs of the requested class, ones with the same <code>storageClassName</code> as the PVC, can
be bound to the PVC.</p>

<p>PVCs don&rsquo;t necessarily have to request a class. A PVC with its <code>storageClassName</code> set
equal to <code>&quot;&quot;</code> is always interpreted to be requesting a PV with no class, so it
can only be bound to PVs with no class (no annotation or one set equal to
<code>&quot;&quot;</code>). A PVC with no <code>storageClassName</code> is not quite the same and is treated differently
by the cluster depending on whether the
<a href="../../../admin/admission-controllers/index.html#defaultstorageclass"><code>DefaultStorageClass</code> admission plugin</a>
is turned on.</p>

<ul>
<li>If the admission plugin is turned on, the administrator may specify a
default <code>StorageClass</code>. All PVCs that have no <code>storageClassName</code> can be bound only to
PVs of that default. Specifying a default <code>StorageClass</code> is done by setting the
annotation <code>storageclass.kubernetes.io/is-default-class</code> equal to &ldquo;true&rdquo; in
a <code>StorageClass</code> object. If the administrator does not specify a default, the
cluster responds to PVC creation as if the admission plugin were turned off. If
more than one default is specified, the admission plugin forbids the creation of
all PVCs.</li>
<li>If the admission plugin is turned off, there is no notion of a default
<code>StorageClass</code>. All PVCs that have no <code>storageClassName</code> can be bound only to PVs that
have no class. In this case, the PVCs that have no <code>storageClassName</code> are treated the
same way as PVCs that have their <code>storageClassName</code> set to <code>&quot;&quot;</code>.</li>
</ul>

<p>Depending on installation method, a default StorageClass may be deployed
to Kubernetes cluster by addon manager during installation.</p>

<p>When a PVC specifies a <code>selector</code> in addition to requesting a <code>StorageClass</code>,
the requirements are ANDed together: only a PV of the requested class and with
the requested labels may be bound to the PVC.</p>

<blockquote class="note">
  <div><strong>Note:</strong> Currently, a PVC with a non-empty <code>selector</code> can&rsquo;t have a PV dynamically provisioned for it.</div>
</blockquote>

<p>In the past, the annotation <code>volume.beta.kubernetes.io/storage-class</code> was used instead
of <code>storageClassName</code> attribute. This annotation is still working, however
it won&rsquo;t be supported in a future Kubernetes release.</p>

<h2 id="claims-as-volumes">Claims As Volumes</h2>

<p>Pods access storage by using the claim as a volume.  Claims must exist in the same namespace as the pod using the claim.  The cluster finds the claim in the pod&rsquo;s namespace and uses it to get the <code>PersistentVolume</code> backing the claim.  The volume is then mounted to the host and into the pod.</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml">kind:<span style="color:#bbb"> </span>Pod<span style="color:#bbb">
</span><span style="color:#bbb"></span>apiVersion:<span style="color:#bbb"> </span>v1<span style="color:#bbb">
</span><span style="color:#bbb"></span>metadata:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>name:<span style="color:#bbb"> </span>mypod<span style="color:#bbb">
</span><span style="color:#bbb"></span>spec:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>containers:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>-<span style="color:#bbb"> </span>name:<span style="color:#bbb"> </span>myfrontend<span style="color:#bbb">
</span><span style="color:#bbb">      </span>image:<span style="color:#bbb"> </span>dockerfile/nginx<span style="color:#bbb">
</span><span style="color:#bbb">      </span>volumeMounts:<span style="color:#bbb">
</span><span style="color:#bbb">      </span>-<span style="color:#bbb"> </span>mountPath:<span style="color:#bbb"> </span><span style="color:#b44">&#34;/var/www/html&#34;</span><span style="color:#bbb">
</span><span style="color:#bbb">        </span>name:<span style="color:#bbb"> </span>mypd<span style="color:#bbb">
</span><span style="color:#bbb">  </span>volumes:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>-<span style="color:#bbb"> </span>name:<span style="color:#bbb"> </span>mypd<span style="color:#bbb">
</span><span style="color:#bbb">      </span>persistentVolumeClaim:<span style="color:#bbb">
</span><span style="color:#bbb">        </span>claimName:<span style="color:#bbb"> </span>myclaim</code></pre></div>
<h3 id="a-note-on-namespaces">A Note on Namespaces</h3>

<p><code>PersistentVolumes</code> binds are exclusive, and since <code>PersistentVolumeClaims</code> are namespaced objects, mounting claims with &ldquo;Many&rdquo; modes (<code>ROX</code>, <code>RWX</code>) is only possible within one namespace.</p>

<h2 id="raw-block-volume-support">Raw Block Volume Support</h2>

<div style="margin-top: 10px; margin-bottom: 10px;">



<b>FEATURE STATE:</b> <code>Kubernetes v1.9</code>




    
    
    
    
    
<a href="../../../user-guide/persistent-volumes/index.html#" id="feature-state-dialog-link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>alpha</a>
<div id="feature-state-dialog" class="ui-dialog-content" title="alpha">
This feature is currently in a <em>alpha</em> state, meaning:</p>

<ul>
<li>The version names contain alpha (e.g. v1alpha1).</li>
<li>Might be buggy. Enabling the feature may expose bugs. Disabled by default.</li>
<li>Support for feature may be dropped at any time without notice.</li>
<li>The API may change in incompatible ways in a later software release without notice.</li>
<li>Recommended for use only in short-lived testing clusters, due to increased risk of bugs and lack of long-term support.</li>
</ul>

</div>
<script>
$(function(){
    
    $( "#feature-state-dialog" ).dialog({
        autoOpen: false,
        width: "600",
        buttons: [
            {
                text: "Ok",
                click: function() {
                    $( this ).dialog( "close" );
                }
            }
        ]
    });

    
    $( "#feature-state-dialog-link" ).click(function( event ) {
        $( "#feature-state-dialog" ).dialog( "open" );
        event.preventDefault();
    });

});
</script>

    

</div>

<p>To enable support for raw block volumes, enable the <code>BlockVolume</code> feature gate on the
apiserver, controller-manager and the kubelet.</p>

<p>The following volume plugins support raw block volumes, including dynamic provisioning where
applicable.</p>

<ul>
<li>AWSElasticBlockStore</li>
<li>AzureDisk</li>
<li>FC (Fibre Channel)</li>
<li>GCEPersistentDisk</li>
<li>iSCSI</li>
<li>Local volume</li>
<li>RBD (Ceph Block Device)</li>
</ul>

<blockquote class="note">
  <div><strong>Note</strong>: Only FC and iSCSI volumes supported raw block volumes in Kubernetes 1.9.
Support for the additional plugins was added in 1.10.</div>
</blockquote>

<h3 id="persistent-volumes-using-a-raw-block-volume">Persistent Volumes using a Raw Block Volume</h3>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml">apiVersion:<span style="color:#bbb"> </span>v1<span style="color:#bbb">
</span><span style="color:#bbb"></span>kind:<span style="color:#bbb"> </span>PersistentVolume<span style="color:#bbb">
</span><span style="color:#bbb"></span>metadata:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>name:<span style="color:#bbb"> </span>block-pv<span style="color:#bbb">
</span><span style="color:#bbb"></span>spec:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>capacity:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>storage:<span style="color:#bbb"> </span>10Gi<span style="color:#bbb">
</span><span style="color:#bbb">  </span>accessModes:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>-<span style="color:#bbb"> </span>ReadWriteOnce<span style="color:#bbb">
</span><span style="color:#bbb">  </span>volumeMode:<span style="color:#bbb"> </span>Block<span style="color:#bbb">
</span><span style="color:#bbb">  </span>persistentVolumeReclaimPolicy:<span style="color:#bbb"> </span>Retain<span style="color:#bbb">
</span><span style="color:#bbb">  </span>fc:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>targetWWNs:<span style="color:#bbb"> </span>[<span style="color:#b44">&#34;50060e801049cfd1&#34;</span>]<span style="color:#bbb">
</span><span style="color:#bbb">    </span>lun:<span style="color:#bbb"> </span><span style="color:#666">0</span><span style="color:#bbb">
</span><span style="color:#bbb">    </span>readOnly:<span style="color:#bbb"> </span><span style="color:#a2f;font-weight:bold">false</span></code></pre></div>
<h3 id="persistent-volume-claim-requesting-a-raw-block-volume">Persistent Volume Claim requesting a Raw Block Volume</h3>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml">apiVersion:<span style="color:#bbb"> </span>v1<span style="color:#bbb">
</span><span style="color:#bbb"></span>kind:<span style="color:#bbb"> </span>PersistentVolumeClaim<span style="color:#bbb">
</span><span style="color:#bbb"></span>metadata:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>name:<span style="color:#bbb"> </span>block-pvc<span style="color:#bbb">
</span><span style="color:#bbb"></span>spec:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>accessModes:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>-<span style="color:#bbb"> </span>ReadWriteOnce<span style="color:#bbb">
</span><span style="color:#bbb">  </span>volumeMode:<span style="color:#bbb"> </span>Block<span style="color:#bbb">
</span><span style="color:#bbb">  </span>resources:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>requests:<span style="color:#bbb">
</span><span style="color:#bbb">      </span>storage:<span style="color:#bbb"> </span>10Gi</code></pre></div>
<h3 id="pod-specification-adding-raw-block-device-path-in-container">Pod specification adding Raw Block Device path in container</h3>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml">apiVersion:<span style="color:#bbb"> </span>v1<span style="color:#bbb">
</span><span style="color:#bbb"></span>kind:<span style="color:#bbb"> </span>Pod<span style="color:#bbb">
</span><span style="color:#bbb"></span>metadata:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>name:<span style="color:#bbb"> </span>pod-with-block-volume<span style="color:#bbb">
</span><span style="color:#bbb"></span>spec:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>containers:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>-<span style="color:#bbb"> </span>name:<span style="color:#bbb"> </span>fc-container<span style="color:#bbb">
</span><span style="color:#bbb">      </span>image:<span style="color:#bbb"> </span>fedora:<span style="color:#666">26</span><span style="color:#bbb">
</span><span style="color:#bbb">      </span>command:<span style="color:#bbb"> </span>[<span style="color:#b44">&#34;/bin/sh&#34;</span>,<span style="color:#bbb"> </span><span style="color:#b44">&#34;-c&#34;</span>]<span style="color:#bbb">
</span><span style="color:#bbb">      </span>args:<span style="color:#bbb"> </span>[<span style="color:#bbb"> </span><span style="color:#b44">&#34;tail -f /dev/null&#34;</span><span style="color:#bbb"> </span>]<span style="color:#bbb">
</span><span style="color:#bbb">      </span>volumeDevices:<span style="color:#bbb">
</span><span style="color:#bbb">        </span>-<span style="color:#bbb"> </span>name:<span style="color:#bbb"> </span>data<span style="color:#bbb">
</span><span style="color:#bbb">          </span>devicePath:<span style="color:#bbb"> </span>/dev/xvda<span style="color:#bbb">
</span><span style="color:#bbb">  </span>volumes:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>-<span style="color:#bbb"> </span>name:<span style="color:#bbb"> </span>data<span style="color:#bbb">
</span><span style="color:#bbb">      </span>persistentVolumeClaim:<span style="color:#bbb">
</span><span style="color:#bbb">        </span>claimName:<span style="color:#bbb"> </span>block-pvc</code></pre></div>
<blockquote class="note">
  <div><strong>Note:</strong> When adding a raw block device for a Pod, we specify the device path in the container instead of a mount path.</div>
</blockquote>

<h3 id="binding-block-volumes">Binding Block Volumes</h3>

<p>If a user requests a raw block volume by indicating this using the <code>volumeMode</code> field in the <code>PersistentVolumeClaim</code> spec, the binding rules differ slightly from previous releases that didn&rsquo;t consider this mode as part of the spec.
Listed is a table of possible combinations the user and admin might specify for requesting a raw block device. The table indicates if the volume will be bound or not given the combinations:
Volume binding matrix for statically provisioned volumes:</p>

<table>
<thead>
<tr>
<th>PV volumeMode</th>
<th align="center">PVC volumeMode</th>
<th align="right">Result</th>
</tr>
</thead>

<tbody>
<tr>
<td>unspecified</td>
<td align="center">unspecified</td>
<td align="right">BIND</td>
</tr>

<tr>
<td>unspecified</td>
<td align="center">Block</td>
<td align="right">NO BIND</td>
</tr>

<tr>
<td>unspecified</td>
<td align="center">Filesystem</td>
<td align="right">BIND</td>
</tr>

<tr>
<td>Block</td>
<td align="center">unspecified</td>
<td align="right">NO BIND</td>
</tr>

<tr>
<td>Block</td>
<td align="center">Block</td>
<td align="right">BIND</td>
</tr>

<tr>
<td>Block</td>
<td align="center">Filesystem</td>
<td align="right">NO BIND</td>
</tr>

<tr>
<td>Filesystem</td>
<td align="center">Filesystem</td>
<td align="right">BIND</td>
</tr>

<tr>
<td>Filesystem</td>
<td align="center">Block</td>
<td align="right">NO BIND</td>
</tr>

<tr>
<td>Filesystem</td>
<td align="center">unspecified</td>
<td align="right">BIND</td>
</tr>
</tbody>
</table>

<blockquote class="note">
  <div><strong>Note:</strong> Only statically provisioned volumes are supported for alpha release. Administrators should take care to consider these values when working with raw block devices.</div>
</blockquote>

<h2 id="writing-portable-configuration">Writing Portable Configuration</h2>

<p>If you&rsquo;re writing configuration templates or examples that run on a wide range of clusters
and need persistent storage, we recommend that you use the following pattern:</p>

<ul>
<li>Do include PersistentVolumeClaim objects in your bundle of config (alongside
Deployments, ConfigMaps, etc).</li>
<li>Do not include PersistentVolume objects in the config, since the user instantiating
the config may not have permission to create PersistentVolumes.</li>
<li>Give the user the option of providing a storage class name when instantiating
the template.

<ul>
<li>If the user provides a storage class name, put that value into the
<code>persistentVolumeClaim.storageClassName</code> field.
This will cause the PVC to match the right storage
class if the cluster has StorageClasses enabled by the admin.</li>
<li>If the user does not provide a storage class name, leave the
<code>persistentVolumeClaim.storageClassName</code> field as nil.</li>
<li>This will cause a PV to be automatically provisioned for the user with
the default StorageClass in the cluster.  Many cluster environments have
a default StorageClass installed, or administrators can create their own
default StorageClass.</li>
</ul></li>
<li>In your tooling, do watch for PVCs that are not getting bound after some time
and surface this to the user, as this may indicate that the cluster has no
dynamic storage support (in which case the user should create a matching PV)
or the cluster has no storage system (in which case the user cannot deploy
config requiring PVCs).</li>
</ul>
















				<div class="issue-button-container">
					<p><a href="../../../user-guide/persistent-volumes/index.html"><img src="https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/concepts/storage/persistent-volumes.md?pixel" alt="Analytics" /></a></p>
					
					
					<script type="text/javascript">
					PDRTJS_settings_8345992 = {
					"id" : "8345992",
					"unique_id" : "\/docs\/concepts\/storage\/persistent-volumes\/",
					"title" : "Persistent Volumes",
					"permalink" : "https:\/\/kubernetes.io\/docs\/concepts\/storage\/persistent-volumes\/"
					};
					(function(d,c,j){if(!document.getElementById(j)){var pd=d.createElement(c),s;pd.id=j;pd.src=('https:'==document.location.protocol)?'https://polldaddy.com/js/rating/rating.js':'http://i0.poll.fm/js/rating/rating.js';s=document.getElementsByTagName(c)[0];s.parentNode.insertBefore(pd,s);}}(document,'script','pd-rating-js'));
					</script>
					<a href="../../../user-guide/persistent-volumes/index.html" onclick="window.open('https://github.com/kubernetes/website/issues/new?title=Issue%20with%20' +
					'k8s.io'+window.location.pathname)" class="button issue">Create an Issue</a>
					
					
					
					<a href="../../../editdocs#docs/concepts/storage/persistent-volumes.md" class="button issue">Edit this Page</a>
					
				</div>
			</div>
		</section>
		<footer>
    <main class="light-text">
        <nav>
            
            
            
            <a href="../../../home.1">Documentation</a>
            
            <a href="../../../../blog/index.html">Blog</a>
            
            <a href="../../../../partners/index.html">Partners</a>
            
            <a href="../../../../community/index.html">Community</a>
            
            <a href="../../../../case-studies/index.html">Case Studies</a>
            
        </nav>
        <div class="social">
            <div>
                <a href="https://twitter.com/kubernetesio" class="twitter"><span>twitter</span></a>
                <a href="https://github.com/kubernetes/kubernetes" class="github"><span>Github</span></a>
                <a href="http://slack.k8s.io/" class="slack"><span>Slack</span></a>
            </div>
            <div>
                <a href="http://stackoverflow.com/questions/tagged/kubernetes" class="stack-overflow"><span>Stack Overflow</span></a>
                <a href="https://discuss.kubernetes.io" class="mailing-list"><span>Forum</span></a>
                <a href="https://calendar.google.com/calendar/embed?src=nt2tcnbtbied3l6gi2h29slvc0%40group.calendar.google.com" class="calendar"><span>Events Calendar</span></a>
            </div>
            <div>
                <a href="../../../getting-started-guides/index.html" class="button">Get Kubernetes</a>
                <a href="https://git.k8s.io/community/contributors/guide" class="button">Contribute</a>
            </div>
        </div>
        <div id="miceType" class="center">
            &copy; 2018 The Kubernetes Authors | Documentation Distributed under <a href="https://git.k8s.io/website/LICENSE" class="light-text">CC BY 4.0</a>
        </div>
        <div id="miceType" class="center">
            Copyright &copy; 2018 The Linux Foundation&reg;. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text">Trademark Usage page</a>
        </div>
    </main>
</footer>

		<button class="flyout-button" onclick="kub.toggleToc()"></button>

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-36037335-10', 'auto');
ga('send', 'pageview');


(function () {
    window.addEventListener('DOMContentLoaded', init)

        
        function init() {
            window.removeEventListener('DOMContentLoaded', init)
                hideNav()
        }

    function hideNav(toc){
        if (!toc) toc = document.querySelector('#docsToc')
        if (!toc) return
            var container = toc.querySelector('.container')

                
                if (container) {
                    if (container.childElementCount === 0 || toc.querySelectorAll('a.item').length === 1) {
                        toc.style.display = 'none'
                            document.getElementById('docsContent').style.width = '100%'
                    }
                } else {
                    requestAnimationFrame(function () {
                        hideNav(toc)
                    })
                }
    }
})();
</script>



	</body>
</html>